﻿@{
    Page.Title = "";
    Layout = "~/_SiteLayout.cshtml";
    string appid = Request.QueryString["appid"];
    string tabid = Request.QueryString["tabid"];
    string typeid = Request.QueryString["typeid"];
    string title = string.Empty;

    Business.Platform.WorkFlowArchives BWFA = new Business.Platform.WorkFlowArchives();
    Business.Platform.WorkFlow BWF = new Business.Platform.WorkFlow();
    if(IsPost)
    {
        title = Request.Form["Title"];
    }
    else
    {
        title = Request.QueryString["Title"];
    }

    string query = string.Format("&appid={0}&tabid={1}&Title={2}&typeid={3}",
                Request.QueryString["appid"],
                Request.QueryString["tabid"],
                title.UrlEncode(), typeid
                );
    string query1 = string.Format("{0}&pagesize={1}&pagenumber={2}", query, Request.QueryString["pagesize"], Request.QueryString["pagenumber"]);
    string pager;
    System.Data.DataTable Dt = BWFA.GetPagerData(out pager, query, title, BWF.GetFlowIDFromType(typeid.ToGuid()));
    
}

<form action="" method="post" >
<div class="querybar">
    <table cellpadding="0" cellspacing="0" border="0" width="100%">
        <tr>
            <td>
                标题：<input type="text" class="mytext" id="Title" name="Title" value="@title" style="width:180px" />
                <input type="submit" name="Search" value="查询" class="mybutton" />
            </td>
        </tr>
    </table>
</div>
<table cellpadding="0" cellspacing="1" border="0" class="listtable">
    <thead>
        <tr>
            <th>标题</th>
            <th>流程</th>
            <th>步骤</th>
            <th>归档时间</th>
        </tr>
    </thead>
    <tbody>
    @{
    foreach (System.Data.DataRow dr in Dt.Rows)
    {
        
        <tr>
            <td><a href="javascript:show('@dr["ID"]');" class="blue">@dr["Title"]</a></td>
            <td>@dr["FlowName"]</td>
            <td>@dr["StepName"]</td>
            <td>@dr["WriteTime"]</td>
        </tr>
    }    
    }
    </tbody>
</table>
<div class="buttondiv">@Html.Raw(pager)</div>
</form>

<script type="text/javascript">
    var appid = '@appid';
    var iframeid = '@tabid';
    var typeid = '@typeid';
    var dialog = top.mainDialog;
    function show(id)
    {
        dialog.open({
            id: "window_" + appid.replaceAll('-', ''), title: "查看归档内容", width: 980, height: 500,
            url: '/Platform/WorkFlow/Archives/Show?id=' + id + '@query1', openerid: iframeid
        });
    }
</script>